<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<%@ include file="../../common/jsp/sheetHeader.jsp" %>
<script>
	$(document).ready(function() {
		var category = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
		//sheet 초기화
		var cfg = {
		    Chart : {
				Animation : true,
		        PlotBackgroundColor : "#FAFAFA",
				PlotBorderColor:"#A9AEB1",
		        PlotBorderWidth:0.5,
				BackgroundColor:{
					LinearGradient : [0,0,100,500],
					Stops : [
						[0, "#D7E1F3"],
						[1, "#FFFFFF"]
					]
				},
				BorderColor : "#84888B",
				
				Type : "columnrange",
				inverted: true,		// x,y 변경
		        Style : {
		            FontSize : "20px"
		        }		
		    },
		    
		    Legend : {
		    	enabled: false
		    },
		    
		    XAxis: {
                categories: category
            },
            
		    YAxis : {
		    	title: {
		            text: 'Temperature ( °C )'
		        }
		    },
		    
		    plotOptions: {
		    	columnrange: {
		        	dataLabels: {
		        		enabled: true,
		        		formatter: function () {
		        			return this.y + '°C';
		        		}
		        	}
		        }
            },
            
            tooltip: {
    	        formatter: function() {
                   	return '<b>'+ category[this.x] +'</b><br/>'
                   	+ '온도: '+ this.point.low + '°C ~ ' + this.point.high + '°C';
                }
    	    }
		}
		
		myChart.SetOptions(cfg);
		
		myChart.SetSeriesOptions([{
			name: 'Temperatures',
	        data: [
				[-9.7, 9.4],
				[-8.7, 6.5],
				[-3.5, 9.4],
				[-1.4, 19.9],
				[0.0, 22.6],
				[2.9, 29.5],
				[9.2, 30.7],
				[7.3, 26.5],
				[4.4, 18.0],
				[-3.1, 11.4],
				[-5.2, 10.4],
				[-13.5, 9.8]
			]
		}]);
		
// 		myChart.DoSearch("../data/chartdata_bar_group.json");
		myChart.Draw();
	});
	
</script>
<title>Column range(gantt) 예제</title>
</head>
<body>
<div id="main">
	<%@ include file="../../common/jsp/chartNavi.jsp" %>	
	<div id="title">Column range(gantt) 예제</div>
	<div id="desc">
		columnrange 타입으로 설정 후, 조회된 데이터를 차트에 좌우로 나눠서 표현한다.
	</div>

	<div id="functionArea">
		chart: {<br>
	    &nbsp;&nbsp;&nbsp;&nbsp;Type : "columnrange",<br>
	    }<br>
	    <br>
	    plotOptions: {<br><font color="#FF0000">
		&nbsp;&nbsp;&nbsp;&nbsp;column:{<br>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stacking:true<br>
		&nbsp;&nbsp;&nbsp;&nbsp;}</font><br>
        }
	</div>
	
	<div id="viewArea">
		<script type="text/javascript">
			createIBChart("myChart", "1000px", "400px");
		</script>
	</div>
</div>
</body>
</html>